package com.example.administrator.dagger2demo.di;

import android.app.Application;
import android.content.res.Resources;

import com.example.administrator.dagger2demo.application.DemoApplication;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;

/**
 * Created by Administrator on 2016/4/12.
 */
@Module
public class MainModule {
    private DemoApplication demoApplication;

    public MainModule(DemoApplication demoApplication) {
        this.demoApplication = demoApplication;
    }

    @Provides
    @Singleton
    protected Application provideApplication() {
        return demoApplication;
    }

    @Provides
    @Singleton
    protected Resources provideResource() {
        return demoApplication.getResources();
    }

}
